// import Home from '../views/Home/index.vue';


import { createRouter, createWebHashHistory } from 'vue-router';
export default createRouter({
  scrollBehavior(to, from, savedPosition) {
    // 始终滚动到顶部
    return { top: 0 };
  },
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home',
      component: () => import('@/views/home/index.vue'),
      children: [
        {
          // 首页
          path: '/home',
          component: () => import('@/views/home/pages/home.vue'),
        },
        {
          // 居家
          path: '/livingHome',
          component: () => import('@/views/home/pages/livingHome.vue'),
        },
        {
          // 美食
          path: '/fineFood',
          component: () => import('@/views/home/pages/fineFood.vue'),
        },
        {
          // 服饰
          path: '/costume',
          component: () => import('@/views/home/pages/costume.vue'),
        },
        {
          // 母婴
          path: '/infant',
          component: () => import('@/views/home/pages/infant.vue'),
        },
        {
          // 个护
          path: '/personalCare',
          component: () => import('@/views/home/pages/personalCare.vue'),
        },
        {
          // 严选
          path: '/select',
          component: () => import('@/views/home/pages/select.vue'),
        },
        {
          // 数码
          path: '/numCode',
          component: () => import('@/views/home/pages/numCode.vue'),
        },
        {
          // 运动
          path: '/exercise',
          component: () => import('@/views/home/pages/exercise.vue'),
        },
        {
          // 杂项s
          path: '/sundry',
          component: () => import('@/views/home/pages/sundry.vue'),
        },
      ],
    },
    {
      path: '/login',
      component: () => import('@/views/login/index.vue'),
    },
  ],
});
